<!-- 使用 type="home" 属性设置首页，其他页面不需要设置，默认为page；推荐使用json5，更强大，且允许注释 -->
<route lang="json5">
{
  style: {
    navigationBarTitleText: '优惠券',
    enablePullDownRefresh: false,
  },
}
</route>
<template>
  <view class="mt-[60rpx] px-4">
    <coupon-list :loading="loading" :list="list" @go="to('index/index')"></coupon-list>
  </view>
</template>

<script setup>
import { to } from '@/utils/navigation'
import useReachBottomLoadMore from '@/hooks/useReachBottomLoadMore'
import { fetchCouponList } from '@/service/user'
const { data: list, loading, run, params } = useReachBottomLoadMore(fetchCouponList)

onLoad(() => {
  run(params.value)
})
</script>

<style lang="scss" scoped></style>
